//
//  MultipeerConnectivityAssistant.h
//  GoodsBTS
//
//  Created by onemade on 14/9/22.
//  Copyright (c) 2014年 CNPC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <MultipeerConnectivity/MultipeerConnectivity.h>

@protocol MultipeerConnecivityAssistantDelegate <NSObject>

@optional
- (void)didChangeState:(MCSessionState)state forPeer:(MCPeerID *)peerId;
- (void)didReceiveData:(NSData *)data fromPeer:(MCPeerID *)peerId;
@end

@interface MultipeerConnectivityAssistant : NSObject<UINavigationControllerDelegate, UIActionSheetDelegate,UIImagePickerControllerDelegate,MCNearbyServiceAdvertiserDelegate, MCSessionDelegate, MCNearbyServiceBrowserDelegate>

@property (weak, nonatomic) id<MultipeerConnecivityAssistantDelegate> delegate;

+ (MultipeerConnectivityAssistant *)sharedService;


@property (strong, nonatomic) MCPeerID * advertiserPeerID;
@property (strong, nonatomic) MCSession * dataSession;
@property (strong, nonatomic) MCNearbyServiceAdvertiser * advertiser;
@property (strong, nonatomic) NSMutableArray * mutableBlockPeers;

@property (strong, nonatomic) MCPeerID *browserPeerID;
@property (strong, nonatomic) MCNearbyServiceBrowser *browser;

-(void)startAdvertiserWithName:(NSString *)name;
-(void)startBrowserWithName:(NSString *)name;
-(void)stopAdvertising;
-(void)stopBrowser;

@end
